package me.muci.abstractFactoryPattern;

import me.muci.abstractFactoryPattern.factory.AbstractFactory;
import me.muci.abstractFactoryPattern.factory.FactoryProducer;

/**
 * ClassName: Test <br/>
 * Description: <br/>
 * date: 2021/8/4 16:01<br/>
 *
 * @author muci<br />
 * @description
 * @since JDK 1.8
 */
public class Test {
    @org.junit.Test
    public void test(){
        AbstractFactory shapeFactory = FactoryProducer.getFactory("SHAPE");
        Shape circle = shapeFactory.getShape("CIRCLE");
        circle.draw();

        AbstractFactory color = FactoryProducer.getFactory("COLOR");
        Color red = color.getColor("RED");
        red.fill();
    }
}
